<?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2020/11/16
 * Time: 17:05
 */

namespace app\api\service;


use think\Db;

class RuleService extends BaseService
{
    /**
     * @name 发送规则
     * @param $hostKey
     * @return array|\PDOStatement|string|\think\Collection
     * @author wx
     * @date 2020/11/17 15:20
     */
    public function send($hostKey)
    {
        $data = Db::name('netfilter_firewall_rule nfr')
            ->join('host h', 'h.id = nfr.host_id')
            ->field('nfr.id, rule_id, content, rank')
            ->where('hostkey', $hostKey)
            ->select();

        return $data;
    }
}